﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YunCMS.Model;

namespace YunCMS.IDAL
{
    public interface IModuleDAL<T>
    {
        /// <summary>
        /// Insert a YCModuleArtical
        /// </summary>
        int Add(T model);

        /// <summary>
        /// update a YCModuleArtical
        /// </summary>
        int Update(T model);

        /// <summary>
        /// delete a YCModuleArtical
        /// </summary>
        int Delete(int id);

        /// <summary>
        /// get the max YCModuleArtical
        ///</summary>
        //int GetMaxId();

        /// <summary>
        /// IsExists?
        /// </summary>
        bool IsExist(int id);

        /// <summary>
        /// Get one YCModuleArtical
        /// </summary>
        T GetModel(int id);

        /// <summary>
        /// Get YCModuleArtical List
        /// </summary>
        IList<T> GetList(string strSql);

        int GetCount(string title, string check, string top);

        IList<T> GetList(string title, string check, string top, int pageSize, int pageCurrent);
        IList<T> GetList(int top, string fields, string strwhere, string order);


        int UpdateOneField(int id, string fieldName, object value);
    }
}
